<?php

class Application_Form_RacksActivos extends Sgit_Form
{

    public function init_form()
    {


         $request= Zend_Controller_Front::getInstance()->getRequest();
         $id_rack=$request->getParam('id_rack');



        $modelo=new Zend_Form_Element_Text('modelo');
         $modelo ->setLabel('Modelo')
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 50));
         $this->addElement($modelo);  
         
         






         $tipo= new Sgit_Form_Element_Select_TipoActivo('tipo_activo');
         $this->addElement($tipo); 
         
         if(!$id_rack){
             $rack= new Sgit_Form_Element_Select_Racks('id_rack');
             $this->addElement($rack); 
         }
        
         
  
         $num_u= new Sgit_Form_Element_NumNull('num_u');
         $num_u->setLabel('Número de U\'s ocupadas');
         $this->addElement($num_u); 
         
         
         $potencia_maxima= new Sgit_Form_Element_NumNull('potencia_maxima');
         $potencia_maxima ->setLabel('Potencia máxima W');
         $this->addElement($potencia_maxima);   
            

         
         $denominacion=new Zend_Form_Element_Text('uso');
         $denominacion ->setLabel('Destino / Uso')
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 255));
         $this->addElement($denominacion);  

         
                  
         $marca=new Zend_Form_Element_Text('marca');
         $marca ->setLabel('Marca')
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 50));
         $this->addElement($marca);  


         
         
         $departamento=new Zend_Form_Element_Text('departamento');
         $departamento ->setLabel('Departamento')
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 100));
         $this->addElement($departamento);      


 
         

        
	    $notas=new Zend_Form_Element_Textarea('notas');
        $notas->setLabel('Observaciones')
                ->setAttribs(array('rows'=>4,'cols'=>60))
                ->addFilter('StringTrim');
        $this->addElement($notas);
       
       
    
       
    
    
      $this->setElementDecorators(array(
		    'ViewHelper',
		   'Errors',
		    array(array('data' => 'HtmlTag'),	array('tag' => 'td', 'class' => 'element')   ),
		    array('Label', array('tag' => 'td')),
		    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
	   ));
       
       
   

        
    }
}
